package com.zqh.cli.command;

import cn.hutool.core.util.ReflectUtil;
import com.zqh.model.DataModel;
import picocli.CommandLine;
import picocli.CommandLine.Command;

import java.lang.reflect.Field;

@Command(name = "config",description = "查看参数信息",mixinStandardHelpOptions = true)
public class ConfigCommand implements Runnable{
    @Override
    public void run() {
        System.out.println("查看参数信息");

        // 获取配置参数类信息
        Field[] fields = ReflectUtil.getFields(DataModel.class);

        for (Field field: fields)
        {
            System.out.println("字段名称：" + field.getName());
            System.out.println("字段类型：" + field.getType());
            System.out.println("——————————");
        }

    }

    public static void main(String[] args) {
        int exitCode = new CommandLine(new ConfigCommand()).execute(args);
        System.exit(exitCode);
    }


}
